package com.ruoyi.system.domain;

import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 持仓对象 inv_postion
 * 
 * @author ruoyi
 * @date 2022-01-13
 */
public class InvPostion extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /**  */
    private Long id;

    /** 证券代码 */
    @Excel(name = "证券代码")
    private String secCode;

    /** 证券名称 */
    @Excel(name = "证券名称")
    private String secName;

    /** 股票余额 */
    @Excel(name = "股票余额")
    private Long secBalance;

    /** 可用余额 */
    @Excel(name = "可用余额")
    private Long secAvailable;

    /** 成本 */
    @Excel(name = "成本")
    private BigDecimal secCost;

    /** 市价 */
    @Excel(name = "市价")
    private BigDecimal secMarket;
    @Excel(name = "金额")
    private BigDecimal secMoney;

   /** 持有天数 */
    @Excel(name = "持有天数")
    private Long secDateNum;

    /** 持有帐号 */
    @Excel(name = "持有帐号")
    private Long secAccount;
    public BigDecimal getSecMoney()
    {
        if (secMarket==null || secBalance==null){
            return null;
        }
        return secMarket.multiply(BigDecimal.valueOf(secBalance));
    }

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setSecCode(String secCode) 
    {
        this.secCode = secCode;
    }

    public String getSecCode() 
    {
        return secCode;
    }
    public void setSecName(String secName) 
    {
        this.secName = secName;
    }

    public String getSecName() 
    {
        return secName;
    }
    public void setSecBalance(Long secBalance) 
    {
        this.secBalance = secBalance;
    }

    public Long getSecBalance() 
    {
        return secBalance;
    }
    public void setSecAvailable(Long secAvailable) 
    {
        this.secAvailable = secAvailable;
    }

    public Long getSecAvailable() 
    {
        return secAvailable;
    }
    public void setSecCost(BigDecimal secCost) 
    {
        this.secCost = secCost;
    }

    public BigDecimal getSecCost() 
    {
        return secCost;
    }
    public void setSecMarket(BigDecimal secMarket) 
    {
        this.secMarket = secMarket;
    }

    public BigDecimal getSecMarket() 
    {
        return secMarket;
    }
    public void setSecDateNum(Long secDateNum) 
    {
        this.secDateNum = secDateNum;
    }

    public Long getSecDateNum() 
    {
        return secDateNum;
    }
    public void setSecAccount(Long secAccount) 
    {
        this.secAccount = secAccount;
    }

    public Long getSecAccount() 
    {
        return secAccount;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("secCode", getSecCode())
            .append("secName", getSecName())
            .append("secBalance", getSecBalance())
            .append("secAvailable", getSecAvailable())
            .append("secCost", getSecCost())
            .append("secMarket", getSecMarket())
            .append("secDateNum", getSecDateNum())
            .append("secAccount", getSecAccount())
            .toString();
    }
}
